
#pragma once

namespace atr {

/**
 * @brief Namespace only for internal use of atr library
 * @details Please don't use this namespace outside the atr library. IF you REALLY need to - do it with special care.
 */
namespace __ {

template <class Prevs, class Nexts>
    struct __reverse;

template <template <class ... > class Base>
struct __reverse<Base<>, Base<>>
    { using type = Base<>; };

template <template <class ... > class Base, class ... Types, class Type>
struct __reverse<Base<Types...>, Base<Type>>
    { using type = Base<Type, Types...>; };

template < template <class ... > class Base
         , class ... Prevs, class Type, class ... Nexts>
struct __reverse<Base<Prevs...>, Base<Type, Nexts...>>
    : public __reverse<Base<Type, Prevs...>, Base<Nexts...>> {};

} // namespace __
} // namespace atr